package com.woniu.payback_font.mapper;


import com.woniu.payback_font.entity.User;
import io.swagger.annotations.Api;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Api(value = "用户登录注册 mapper接口")
public interface UserMapper {
    int deleteByPrimaryKey(Integer uId);

    int insert(User record);

    User selectByPrimaryKey(Integer uId);

    List<User> selectAll();

    int updateByPrimaryKey(User record);


    /**
     * 根据用户名查出一条user记录（专门用于登录注册）
     * @param uName 用户名
     * @return
     */
    @Select("select * from t_user where u_name=#{uName}  ")
    User findByuname(String uName);

    /**
     * 用户注册
     * @param user
     * @return
     */
    int insertUser(User user);
}